package com.km.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

//监听器
public class ExcelListener extends AnalysisEventListener<UserData> {

    //这个方法的作用：一行一行的读取excel内容，从第二行读取的（第一行是表头）
    @Override
    public void invoke(UserData userData, AnalysisContext analysisContext) {
        System.out.println(userData);
    }

    @Override
    public void invokeHeadMap(Map<Integer,String> headMap,AnalysisContext context){
        System.out.println("表头信息："+headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
